<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>部门信息管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/static/css/font.css">
    <link rel="stylesheet" href="/static/css/xadmin.css">
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
    <script  src="/static/js/echarts.min.js"></script>
    <script type="text/javascript" src="/static/lib/layui/layui.js" charset="utf-8"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>
  <body>
      <div class="x-body">
          <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
          {%if request.user.is_superuser == 1 %}
          <div id="main" style="width: 100%;height:400px;"></div>
          {% endif %}
          {%if request.user.is_superuser == 0 %}
          <div id="main" style="width: 100%;height:1600px;"></div>
          {% endif %}
      </div>
      <script type="text/javascript">
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '部门分布柱状图'
            },
            tooltip: {
                trigger: 'axis',
                axisPointer:{
                  type:'shadow'
                }
            },
            legend: {
                data:['员工类别1、员工类别2','家属']
            },
            grid: {
                left: '3%',
                right: '4%',
                bottom: '5%',
                containLabel: true
            },
            xAxis: {
                type: 'value',
            },
            yAxis: {
                type: 'category',
                boundaryGap: false,
                data: {{ data|safe }}
            },
            series: {{ ContentInfo|safe }}
        }; 


        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>

  </body>
</html>